package com.candy.service;

import com.candy.dao.DBProvider;
import com.candy.pojo.UserBean;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import java.util.List;

public class LoginService {
//    判断登录信息是否正确
    public boolean logined(String username,String userpwd){
//        若用户名密码匹配则返回true
        String querySql="select * from userinfo where username=? and userpwd=? ";
       List<UserBean> lu= DBProvider.query(querySql,new BeanListHandler<>(UserBean.class),username,userpwd);

        if(lu!=null&&lu.size()>0){
            return true;
        }
//        若用户名密码不匹配则返回false
        return false;
    }




}
